home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness: Critical Thinking Skills / Workplace Effectiveness: Critical Thinking Skills.iso / pc / Files / Main.dxr / 00004_PRINT Scripts.ls < prev    next >
Encoding:
Text File  |  1998-09-17  |  3.9 KB  |  90 lines

  1. global gMasterData, gMachineData, gNoteArchive
  2.  
  3. on gatherAllParts
  4.   if activationOn(gMasterData, #define, #define) then
  5.     set vText_1 to the text of member "define field" of castLib "Shared"
  6.   else
  7.     set vText_1 to "Part 1, Defining Critical Thinking, not completed by user." & RETURN & "--------------------------------------------------------------"
  8.   end if
  9.   if activationOn(gMasterData, #menu, #island1) then
  10.     set vText_2 to the text of member "Island1 field" of castLib "Shared"
  11.   else
  12.     set vText_2 to "Part 2, Exploring Natural Abilities, not completed by user." & RETURN & "--------------------------------------------------------------"
  13.   end if
  14.   if activationOn(gMasterData, #menu, #island2) then
  15.     set vText_3 to the text of member "Island2 field" of castLib "Shared"
  16.   else
  17.     set vText_3 to "Part 3, Acquiring New Skills, not completed by user." & RETURN & "--------------------------------------------------------------"
  18.   end if
  19.   if activationOn(gMasterData, #skilluse, #skilluse) then
  20.     set vText_4 to the text of member "skilluse field" of castLib "Shared"
  21.   else
  22.     set vText_4 to "Part 4, Using Critical Thinking Skills, not completed by user." & RETURN & "--------------------------------------------------------------"
  23.   end if
  24.   set vAllText to "Workplace Effectiveness, Critical Thinking Skills" & RETURN & "Exploration begun at " & getTimeDate(gMachineData) & RETURN & RETURN
  25.   put vText_1 & RETURN & RETURN & vText_2 & RETURN & RETURN & vText_3 & RETURN & RETURN & vText_4 & RETURN & RETURN after vAllText
  26.   if voidp(gNoteArchive) then
  27.     put "No notes were entered during this session." & RETURN after vAllText
  28.   else
  29.     put "The following are the notes you entered during this session:" & RETURN & gNoteArchive & RETURN after vAllText
  30.   end if
  31.   set the text of member "PrintAllAnswers" to vAllText
  32.   return vAllText
  33. end
  34.  
  35. on writeScoreFile vBigString
  36.   set ScoreFN to getOSDirectory() & the pathSep of gMachineData & "score.txt"
  37.   put "ScoreFN = " && ScoreFN
  38.   set writeScObj to new(xtra("fileio"))
  39.   openFile(writeScObj, ScoreFN, 2)
  40.   set wrStatus to status(writeScObj)
  41.   case wrStatus of
  42.     0:
  43.       writeString(writeScObj, vBigString)
  44.       set wrStatus to status(writeScObj)
  45.       if wrStatus <> 0 then
  46.         displayErrorMsg("attempting to write your Score information.", wrStatus, writeScObj)
  47.       end if
  48.       closeFile(writeScObj)
  49.       set writeScObj to 0
  50.       alert("The file" && QUOTE & "score.txt" & QUOTE && "containing your data has been saved to the computer startup disk.")
  51.     (-43), (-37):
  52.       createFile(writeScObj, ScoreFN)
  53.       set wrStatus to status(writeScObj)
  54.       if wrStatus <> 0 then
  55.         displayErrorMsg("attempting to write your Score information(CREerr).", wrStatus, writeScObj)
  56.       end if
  57.       openFile(writeScObj, ScoreFN, 2)
  58.       set wrStatus to status(writeScObj)
  59.       if wrStatus <> 0 then
  60.         displayErrorMsg("attempting to write your Score information.(CRE/OPNerr)", wrStatus, writeScObj)
  61.       end if
  62.       setFinderInfo(writeScObj, "TEXTTTXT")
  63.       writeString(writeScObj, vBigString)
  64.       set wrStatus to status(writeScObj)
  65.       if wrStatus <> 0 then
  66.         displayErrorMsg("attempting to write your Score information.", wrStatus, writeScObj)
  67.       end if
  68.       closeFile(writeScObj)
  69.       set writeScObj to 0
  70.       alert("The file" && QUOTE & "score.txt" & QUOTE && "containing your data has been saved to the computer startup disk.")
  71.     otherwise:
  72.       displayErrorMsg("attempting to write your Score information. The error:", wrStatus, writeScObj)
  73.   end case
  74. end
  75.  
  76. on displayErrorMsg whatMsg, whatError, whatObj
  77.   alert("An error has occured" && whatMsg && "The error:" && error(whatObj, whatError))
  78. end
  79.  
  80. on FindfieldNames thisCast
  81.   set fieldNameList to []
  82.   set vCastNameOrNum to thisCast
  83.   repeat with x = 1 to 600
  84.     if the type of member x of castLib vCastNameOrNum = #field then
  85.       add(fieldNameList, the name of member x of castLib vCastNameOrNum)
  86.     end if
  87.   end repeat
  88.   put fieldNameList
  89. end
  90.